package com.scuec.groupfive.controller;

import com.scuec.groupfive.service.WeakStatisticsService;
import com.scuec.groupfive.vo.WeakPointVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 薄弱知识点排行榜Controller
 */
@RestController
@RequestMapping("/api/weak-statistics")
public class WeakStatisticsController {

    @Autowired
    private WeakStatisticsService weakStatisticsService;

    @GetMapping("/ranking")
    public List<WeakPointVO> getWeakPointRanking(
            @RequestParam Long userId,
            @RequestParam Integer subjectId) {
        return weakStatisticsService.getWeakPointRanking(userId, subjectId);
    }
}
